/*package com.mqserver.controller;



import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

import com.soa.eis.adapter.framework.exception.EisException;
import com.soa.eis.adapter.framework.message.IMsgObject;
import com.soa.eis.adapter.framework.message.impl.GroupRecord;
import com.soa.eis.adapter.framework.message.impl.MsgObject;
import com.soa.eis.adapter.framework.requester.IServiceRequester;
import com.soa.eis.adapter.framework.requester.impl.BaseServiceRequester;
import com.soa.eis.adapter.framework.utils.log.LogUtil;

public class TestRequester {
	*//**
	 * 使用BaseServiceRequester进行服务调用
	 * @throws Exception 
	 *//*
	public void requester() throws Exception{
		// 获取服务调用者实例
		IServiceRequester Requester = BaseServiceRequester.getInstance();
		// 定义请求报文对象
		IMsgObject reqMo = new MsgObject(IMsgObject.MOType.initSR);
		String SourceSysID = "06001";       //请求方(发布方) 系统号
		String ServiceID = "06001100000001";//响应方(发布方) 服务号

		//获取系统时间
		Date date = new Date();
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
		String format = simpleDateFormat.format(date);
		//对请求报文对象进行设置
		reqMo.setSourceSysID(SourceSysID); //设置报文 请求方系统号      
		reqMo.setServiceID(ServiceID);     //设置报文 提供方服务号
		
		reqMo.setSerialNO(format.substring(0, 8)+SourceSysID+"000001");//设置报文流水号,第三段表示今天发送的第几的一次报文


//		reqMo.setControlValue("Username", "GUESTERM");
//		reqMo.setControlValue("Password", "GUESTERM");
//		


		
		//人员发布
	reqMo.setReqValue("ControlType", "5");
		
		List<GroupRecord> grs1 = new ArrayList<GroupRecord>();
		GroupRecord gr1 = new GroupRecord();
	gr1.setName("ROW");
		
		
		
		
		//人员
gr1.setFieldValue("NAME", "1");
		    gr1.setFieldValue("UPDATE_MAN", "1");
	        gr1.setFieldValue("BIRTHDAY", "1979-08-24");
			gr1.setFieldValue("SEX", "女");
			gr1.setFieldValue("COUNTRY", "HI200000000000002002");
			gr1.setFieldValue("NATIVEPLACE", "HRPMPLYA000000001274");
			gr1.setFieldValue("MOBILEPHONE", "13859013287");		
			gr1.setFieldValue("EDUCATION", "0001K71000000000054B");
			gr1.setFieldValue("MAJOR", "test1");
			gr1.setFieldValue("UNIVERSITIES", "福建职业技术学院");
			gr1.setFieldValue("IN_TIME", "2002-05-01");
			gr1.setFieldValue("DUTY_STATUS", "0");
			gr1.setFieldValue("EPLOYEE_TYPE", "0001K7100000000001PF");
			gr1.setFieldValue("TELEPHONE", "05947795151");
			gr1.setFieldValue("EMAIL", "xiaowenjin998@163.com");
			gr1.setFieldValue("WORKING_YEARS", "2016-12-22");
			gr1.setFieldValue("POST_NAME", "1008N3100000000CY2L7");
			gr1.setFieldValue("VERSION", "2016-12-22");
			gr1.setFieldValue("MDM_CODE", "084655");
			gr1.setFieldValue("UPDATE_DATE", "2016-12-22");
		
			


	//组织
gr1.setFieldValue("NO", "2017030906001000237");
	gr1.setFieldValue("DEPT_LEADER", "22");
	gr1.setFieldValue("UPDATE_MAN", "test2");
	gr1.setFieldValue("DEPT_NAME", "1");
	gr1.setFieldValue("DEPT_SHORT_NAME", "HI200000000000002002");
	gr1.setFieldValue("DEPT_DESC", "HRPMPLYA000000001274");
	gr1.setFieldValue("DEPT_REPRESENT", "13859013287");		
	gr1.setFieldValue("ADDRESS", "2");
	gr1.setFieldValue("TELEPHONE", "小罗231qqqqq132");
	gr1.setFieldValue("UPDATE_DATE", "2016-12-22");
	gr1.setFieldValue("MDM_CODE", "333");
	gr1.setFieldValue("ZIP_CODE", "1008");
	gr1.setFieldValue("BUSINESS_LICENCE", "00002222");
	gr1.setFieldValue("DEPT_TYPE", "2");
	gr1.setFieldValue("VERSION", "05947795151");
	gr1.setFieldValue("EMAIL", "xiaowenjin998@163.com");
	gr1.setFieldValue("VERSION", "1");
	gr1.setFieldValue("PK_CORP", "1");
	
	//xiala
gr1.setFieldValue("MDM_CODE", "22");
	gr1.setFieldValue("BOID", "test2");
	gr1.setFieldValue("C_PARENT", "1");
	gr1.setFieldValue("C_KEY", "HI200000000000002002");
	gr1.setFieldValue("C_VALUE", "HRPMPLYA000000001274");
	gr1.setFieldValue("REMARK", "13859013287");		
	gr1.setFieldValue("C_INDEX", "2");
	
		grs1.add(gr1);	
		reqMo.setReqGroupRecord(grs1);
		
		
		

		
	
		//打印请求报文对象
		LogUtil.getInstance().info(reqMo);
		


		
		IMsgObject respMo = null;
		try{
			long start = System.currentTimeMillis();
			//传入请求报文对象，返回响应报文对象。
			respMo = Requester.execute(reqMo);
			long end = System.currentTimeMillis();
			LogUtil.getInstance().info("\n");
			LogUtil.getInstance().info("本次请求共耗时: "+ (end-start) + "毫秒");
			LogUtil.getInstance().info("\n");
			LogUtil.getInstance().info("///////////////////////////////XML格式化打印//////////////////////////////////");
			LogUtil.getInstance().info(respMo);
			
			
//

			
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	

	public static void main(String args[]) throws EisException, IOException
	{		
		try {
			new TestRequester().requester();
		} catch (Exception e) {
			LogUtil.getInstance().error(EisException.getTrace(e));
		}
	}

}







package com.mqserver.controller;



import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

import com.soa.eis.adapter.framework.exception.EisException;
import com.soa.eis.adapter.framework.message.IMsgObject;
import com.soa.eis.adapter.framework.message.impl.GroupRecord;
import com.soa.eis.adapter.framework.message.impl.MsgObject;
import com.soa.eis.adapter.framework.requester.IServiceRequester;
import com.soa.eis.adapter.framework.requester.impl.BaseServiceRequester;
import com.soa.eis.adapter.framework.utils.log.LogUtil;

public class TestRequester {

	public void requester() throws Exception{
		// 获取服务调用者实例
		IServiceRequester Requester = BaseServiceRequester.getInstance();
		// 定义请求报文对象
		IMsgObject reqMo = new MsgObject(IMsgObject.MOType.initSR);
		String SourceSysID = "06004";       //请求方(发布方) 系统号
		String ServiceID = "06001100000001";//响应方(发布方) 服务号

		//获取系统时间
		Date date = new Date();
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
		String format = simpleDateFormat.format(date);
		//对请求报文对象进行设置
		reqMo.setSourceSysID(SourceSysID); //设置报文 请求方系统号      
		reqMo.setServiceID(ServiceID);     //设置报文 提供方服务号
		
		reqMo.setSerialNO(format.substring(0, 8)+SourceSysID+"000001");//设置报文流水号,第三段表示今天发送的第几的一次报文


//		reqMo.setControlValue("Username", "GUESTERM");
//		reqMo.setControlValue("Password", "GUESTERM");
//		


		
		//人员发布
	reqMo.setReqValue("ControlType", "5");
		
		List<GroupRecord> grs1 = new ArrayList<GroupRecord>();
		GroupRecord gr1 = new GroupRecord();
	gr1.setName("ROW");
		
		
		
		
		//人员
gr1.setFieldValue("NAME", "1");
		    gr1.setFieldValue("UPDATE_MAN", "1");
	        gr1.setFieldValue("BIRTHDAY", "1979-08-24");
			gr1.setFieldValue("SEX", "女");
			gr1.setFieldValue("COUNTRY", "HI200000000000002002");
			gr1.setFieldValue("NATIVEPLACE", "HRPMPLYA000000001274");
			gr1.setFieldValue("MOBILEPHONE", "13859013287");		
			gr1.setFieldValue("EDUCATION", "0001K71000000000054B");
			gr1.setFieldValue("MAJOR", "test1");
			gr1.setFieldValue("UNIVERSITIES", "福建职业技术学院");
			gr1.setFieldValue("IN_TIME", "2002-05-01");
			gr1.setFieldValue("DUTY_STATUS", "0");
			gr1.setFieldValue("EPLOYEE_TYPE", "0001K7100000000001PF");
			gr1.setFieldValue("TELEPHONE", "05947795151");
			gr1.setFieldValue("EMAIL", "xiaowenjin998@163.com");
			gr1.setFieldValue("WORKING_YEARS", "2016-12-22");
			gr1.setFieldValue("POST_NAME", "1008N3100000000CY2L7");
			gr1.setFieldValue("VERSION", "2016-12-22");
			gr1.setFieldValue("MDM_CODE", "084655");
			gr1.setFieldValue("UPDATE_DATE", "2016-12-22");
		
			




	
		grs1.add(gr1);	
		reqMo.setReqGroupRecord(grs1);
		
		
		

		
	
		//打印请求报文对象
		LogUtil.getInstance().info(reqMo);
		


		
		IMsgObject respMo = null;
		try{
			long start = System.currentTimeMillis();
			//传入请求报文对象，返回响应报文对象。
			respMo = Requester.execute(reqMo);
			long end = System.currentTimeMillis();
			LogUtil.getInstance().info("\n");
			LogUtil.getInstance().info("本次请求共耗时: "+ (end-start) + "毫秒");
			LogUtil.getInstance().info("\n");
			LogUtil.getInstance().info("///////////////////////////////XML格式化打印//////////////////////////////////");
			LogUtil.getInstance().info(respMo);
			
			
//

			
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	

	public static void main(String args[]) throws EisException, IOException
	{		
		try {
			new TestRequester().requester();
		} catch (Exception e) {
			LogUtil.getInstance().error(EisException.getTrace(e));
		}
	}

}






*/
package fy.hr.dao;



import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import com.soa.eis.adapter.framework.exception.EisException;
import com.soa.eis.adapter.framework.message.IMsgObject;
import com.soa.eis.adapter.framework.message.impl.GroupRecord;
import com.soa.eis.adapter.framework.message.impl.MsgObject;
import com.soa.eis.adapter.framework.requester.IServiceRequester;
import com.soa.eis.adapter.framework.requester.impl.BaseServiceRequester;
import com.soa.eis.adapter.framework.utils.log.LogUtil;

import fy.hr.constant.OA2HRConstant;
import fy.util.MyUtil;



public class TestRequester2 {
	/**
	 * 使用BaseServiceRequester进行服务调用
	 * @throws Exception 
	 */
	public void requester() throws Exception{
		// 获取服务调用者实例
		IServiceRequester Requester = BaseServiceRequester.getInstance();
		/*// 定义请求报文对象
		IMsgObject reqMo = new MsgObject(IMsgObject.MOType.initSR);
		String SourceSysID = "06004";       //请求方(发布方) 系统号
		String ServiceID = "06003000000008";//响应方(发布方) 服务号
		//获取系统时间
		Date date = new Date();
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
		String format = simpleDateFormat.format(date);
		//对请求报文对象进行设置
		reqMo.setSourceSysID(SourceSysID); //设置报文 请求方系统号      
		reqMo.setServiceID(ServiceID);     //设置报文 提供方服务号
		reqMo.setSerialNO(format.substring(0, 8)+SourceSysID+"000001");//设置报文流水号,第三段表示今天发送的第几的一次报文
		reqMo.setServiceDateTime("simpleDateFormat");
		reqMo.setReqValue("string", "084655");
		//打印请求报文对象
		LogUtil.getInstance().info(reqMo);
		IMsgObject respMo = null;
		respMo = Requester.execute(reqMo);
		List<GroupRecord> record2 = respMo.getResGroupRecord("return") ;
		for (GroupRecord groupRecord : record2) {

			groupRecord.getFieldValue("psnname");
			System.out.println("~~~~~~~~~~~~~~~~~"+groupRecord.getFieldValue("psnname"));
			
		}		*/
	//	IServiceRequester Requester = BaseServiceRequester.getInstance();
		// 定义请求报文对象
		List<GroupRecord> grs1 = new ArrayList<GroupRecord>();
		IMsgObject reqMo = new MsgObject(IMsgObject.MOType.initSR);
		String SourceSysID = "06004"; // 请求方(发布方) 系统号
		String ServiceID = "06003000000005";// 响应方(发布方) 服务号
		// 获取系统时间
		Date date = new Date();
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
		String format = simpleDateFormat.format(date);
		// 对请求报文对象进行设置
		reqMo.setSerialNO(
				format.substring(0, 8) + SourceSysID + String.format("%06d", ++RequestNoTimerTask.requestNo));
		// reqMo.setSerialNO(format.substring(0, 8) + SourceSysID +
		// "000001");// 设置报文流水号,第三段表示今天发送的第几的一次报文
		reqMo.setServiceID(ServiceID); // 设置报文 提供方服务号
		reqMo.setServiceDateTime(format);
		reqMo.setSourceSysID(SourceSysID); // 设置报文 请求方系统号
		reqMo.setControlValue("", null);
		GroupRecord gr1 = new GroupRecord();
	//	awayFormBean.setPk_away_h(MyUtil.createUUID());
		gr1.setName("awayPushHVO");
		gr1.setFieldValue("status", "0");
		gr1.setFieldValue("dirty", "1");
		gr1.setFieldValue("primaryKey", "1");
		gr1.setFieldValue("aPPLIER", "");
		gr1.setFieldValue("iSAPPBILL", "N");
		gr1.setFieldValue("aWAYTYPE","1002N310000000000A29");
		gr1.setFieldValue("aWAYID", "5757311243926459290");
		gr1.setFieldValue("fUN_CODE", "123");
		gr1.setFieldValue("aPPROVEIDEA", "");
		gr1.setFieldValue("dR", "0");
		gr1.setFieldValue("aPPLYDATE","2016-12-22");
		gr1.setFieldValue("aPPLYDEPT", "1004K7100000000000RY");
		gr1.setFieldValue("aPPROVEDATE", "");
		gr1.setFieldValue("aPPROVESTATUS", "200");
		gr1.setFieldValue("pK_AWAY_H", "");
		gr1.setFieldValue("iSHRSSBILL", "N");
		gr1.setFieldValue("tS", "2017-03-16 19:08:47");
		gr1.setFieldValue("bILLNAME","FIN23出差申请单(林超 2016-12-22 12:29)");
		gr1.setFieldValue("sUBMITTER", "");
		gr1.setFieldValue("pK_CORP", "1004");
		gr1.setFieldValue("cENSOR", "");
		gr1.setFieldValue("pK_BUSITYPE", "");
		gr1.setFieldValue("sUBMIT_DATE", "");
		grs1.add(gr1);
		GroupRecord gr2 = new GroupRecord();
		gr2.setName("awayPushBVO");
		gr2.setFieldValue("status", "0");
		gr2.setFieldValue("dirty", "1");
		gr2.setFieldValue("primaryKey", "1");
		gr2.setFieldValue("wORKFINISH", "");
		gr2.setFieldValue("pSNCODE", "0001N310000000018R7O");
		gr2.setFieldValue("rEMARK", "");
		gr2.setFieldValue("aHEADFEE", "");
		gr2.setFieldValue("bACKDATE", "");
		gr2.setFieldValue("aWAYENDTIME","");
		gr2.setFieldValue("dR", "0");
		gr2.setFieldValue("aWAYBEGINDAY","2016-12-01");
		gr2.setFieldValue("pLANBEGINTIME", "");
		gr2.setFieldValue("pK_AWAY_H","");
		gr2.setFieldValue("iFAPPROVE", "N");
		gr2.setFieldValue("pK_AGENTPSN", "");
		gr2.setFieldValue("aWAYADDRESS", "1");
		gr2.setFieldValue("tS", "2017-03-16 19:08:47	");
		gr2.setFieldValue("aWAYBEGINTIME","");
		gr2.setFieldValue("aWAYENDDAY", "2016-12-01");
		gr2.setFieldValue("hWORKPROCESS", "");
		gr2.setFieldValue("aWAYOFFSTATUS", "2");
		gr2.setFieldValue("pK_TBM_PSNDOC", "1004N3100000001BYOL3");
		gr2.setFieldValue("aWAYNOTE", "");
		gr2.setFieldValue("aWAYSUMHOUR", "");
		gr2.setFieldValue("fACTFEE", "");
		gr2.setFieldValue("sUMHOUR", "");
		gr2.setFieldValue("pK_AWAY_B", MyUtil.createUUID());
		gr2.setFieldValue("bACKTIME", "");
		gr2.setFieldValue("pLANBEGINDAY", "");
		gr2.setFieldValue("pLANENDDAY", "");
		gr2.setFieldValue("aWAYPSNORDER", "0");
		gr2.setFieldValue("pLANENDTIME", "");
		grs1.add(gr2);
		reqMo.setReqGroupRecord(grs1);
		IMsgObject respMo = null;
		respMo = Requester.execute(reqMo);
		System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1"+respMo);
		if (!respMo.getResValue("return").equals("false")) {
			System.out.println("input success");
			//log.info(String.valueOf(this.awayFormBean.getSummaryId()) + " input success");
		} else {
			System.out.println("input fail");
			//log.info(String.valueOf(this.awayFormBean.getSummaryId()) + " input fail");
		}
	}
	
	
	

	public static void main(String args[]) throws EisException, IOException
	{		
		try {
			new TestRequester2().requester();
		} catch (Exception e) {
			LogUtil.getInstance().error(EisException.getTrace(e));
		}
	}

}






